<!DOCTYPE html>

<html xmlns:th="http://www.thymeleaf.org">
<head>
<head>

</head>
<body>

<div th:fragment="nav">
    <nav class="navbar navbar-default top-nav">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-headers">
                <a href="/">
                    <img class="logo" src="/images/xia.jpg">
                </a>

                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">community</span>
                </button>

                <a class="navbar-brand community-name" href="/">Autodidact</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <!--<li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>-->
                    <!--<li><a href="#">Link</a></li>-->
                    <!--<li class="dropdown">-->
                    <!--<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>-->
                    <ul class="dropdown-menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">Separated link</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">One more separated link</a></li>
                    </ul>
                    </li>
                </ul>

                <form class="navbar-form navbar-left" action="/" method="get">
                    <div class="form-group">

                        <input type="text" class="form-control" name="search" placeholder="search topic">
                    </div>
                    <button type="submit" class="btn btn-default">search</button>
                </form>
                <ul class="nav navbar-nav navbar-right">
                    <li th:if="${session.user!= null}">
                        <div class="AliLogo-box">
                            <i class="iconfont icon-fabu navbar_ali_icon"></i>
                            <a href="/publish">publish</a>
                        </div>

                    </li>
                    <li th:if="${session.user!= null}">

                        <div class="AliLogo-box">
                            <i class="iconfont icon-bizhi navbar_ali_icon"></i>
                            <a  href="/wallpaper" style="text-decoration:none;">wallpaper</a>
                        </div>
                    </li>

                    <li th:if="${session.user!= null}">
                        <div class="AliLogo-box">
                            <i class="iconfont icon-youjian navbar_ali_icon"></i>
                            <a href="/profile/replies" th:if="${session.user != null}">notice <span class="badge">
                            <span th:text="${session.unreadCount}"></span>
                            </span>
                            </a>
                        </div>

                    </li>

                    <li class="dropdown" th:if="${session.user!= null}">
                        <div class="AliLogo-box">
                            <i class="iconfont icon-heike navbar_ali_icon"></i>
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                                <span th:text="${session.user.getName()}"></span>
                                <span class="caret"></span>
                            </a>
                            <ul class="dropdown-menu">
                                <li><a href="/profile/questions">My Questions</a></li>
                                <li><a href="/modifyProfile">Modify Profile</a></li>
                                <li><a href="/logout">Logout</a></li>

                            </ul>
                        </div>
                    </li>

                    <div class="Log-style">

                        <li th:if="${session.user == null}">
                            <a href="/login">
                                <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
                            </a>

                            <a class="Log-font" style="text-decoration:none;" href="/login">Login</a>
                            <a href="/loginByQQ">
                                <img class="logo" src="/images/QQ.jpg">

                            </a>



                        </li>
                    </div>

                </ul>
            </div>
        </div>
    </nav>
</div>

</body>

</html>
